
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${NANE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${NANE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${NANE_BINARY_DIR}/bin")

if( NANE_ASSERTION_ENABLED )
    add_definitions( -DNANE_ASSERTION_ENABLED )
endif()

if( MSVC )
    set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /Zm1000 /MP2 /EHsc /GR")
    set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Zi /Ob0 /Od /RTC1")
    set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /D NDEBUG")
    set(CMAKE_C_FLAGS "/DWIN32 /D_WINDOWS /W3 /Zm1000")
    set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Zi /Ob0 /Od /RTC1")
    set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /D NDEBUG")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
    add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
elseif( MINGW )
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif()

set( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${NANE_SOURCE_DIR}/cmake )

nane_add_implementation( SerializeSystem cfg )
nane_add_implementation( ScriptSystem lua )
nane_add_implementation( RenderSystem ogl )
#nane_add_implementation( InputDeviceSystem dummy )
nane_add_implementation( WindowSystem dummy )
nane_add_implementation( SoundSystem OAL )
nane_add_implementation( FileArchiveSystem Directory )
nane_add_implementation( FileArchiveSystem ZIP )
nane_add_implementation( ImageCodecSystem PNG )
nane_add_implementation( SoundCodecSystem WAV )
nane_add_implementation( SoundCodecSystem OGG )

set( NANE_LIB_MODE STATIC )
set( NANE_PLATFORM_LIBS )
